<template>
	<div class="selected">
		<header>
			<span>精选推荐</span>
		</header>
		<div class="item-list">
			<ul>
				<li v-for="item in arr" :key="item.pid">
					<router-link :to="'/details?pid='+item.pid">
						<div class="top">
							<img :src="item.img" >
							<span>{{item.theme_label}}{{item.place_label?' | '+item.place_label:''}}</span>
						</div>
						<label>{{item.name}}</label>
						<section>
							<label>
								<template v-if="item.minprice>0">
									<strong>￥{{item.minprice}}</strong> 起
								</template>
								<template v-else><strong>{{item.minprice}}</strong></template>
							</label>
							<span>{{item.days}}</span>
						</section>
					</router-link>
				</li>
			</ul>
		</div>
	</div>
</template>

<script>
export default{
	name:'Selected',
	props:['list'],
	data(){
		return {
			arr:[]
		}
	},
	watch:{
		list(val){
			this.arr = val;
		}
	}
}
</script>

<style scoped>
a{
	text-decoration: none;
	color: black;
}
.selected{
	width: 100%;
	margin-top: 0.5rem;
	overflow: hidden;
}
.selected header{
	text-align: center;
	font-size: 0.45rem;
	font-weight: bold;
}
.selected header span::before{
	display: inline-block;
	margin: 0 0.1rem;
	width: 0.55rem;
	height: 0.4rem;
	content: '';
	background-image: url(../../../assets/img/img19.750c255a.png);
	background-size: 100% 100%;
}
.selected header span::after{
	display: inline-block;
	margin: 0 0.1rem;
	width: 0.55rem;
	height: 0.4rem;
	content: '';
	background-image: url(../../../assets/img/img20.51bebaf2.png);
	background-size: 100% 100%;
}
.selected .item-list{
	width: 95%;
	margin: 0.5rem auto 0;
}
.selected .item-list ul{
	width: 100%;
	display: flex;
	flex-wrap: wrap;/*强制换行*/
	justify-content: space-between;
}
.selected .item-list ul li{
	width: 48%;
	position: relative;
}
.selected .item-list ul li .top img{
	width: 100%;
	border-radius: 0.1rem;
}
.selected .item-list ul li .top span{
	position: absolute;
	top: 0.2rem;
	left: 0;
	color: white;
	padding: 0.12rem 0.25rem;
	background: rgba(0,0,0,0.6);
	border-radius: 0 0.2rem 0.2rem 0;
}
.selected .item-list ul li label{
	font-size: 0.35rem;
	line-height: 0.4rem;
	height: 0.8rem;
	overflow: hidden;
	display: -webkit-box;/* 转换为盒子 */
	-webkit-line-clamp: 2;/* 跟高度有关 */
	-webkit-box-orient: vertical;/* 超出盒子外的文本用省略号代替 */
}
.selected .item-list ul li section{
	display: flex;
	align-items: center;
	line-height: 0.8rem;
	color: #737373;
	font-size: 0.25rem;
	justify-content: space-between;
}
.selected .item-list ul li section label{
	font-size: 0.2rem;
	line-height: 0.8rem;
}
.selected .item-list ul li section strong{
	font-weight: bold;
	font-size: 0.4rem;
	color: #fe7100;
}
.selected .item-list ul li section span{
	background-color: #eeeeee;
	padding: 0 0.2rem;
	line-height: 0.5rem;
}
</style>
